--- strings
local data = {
	DS = {
		-- 1
		"熔化的弹珠",
		"假卡祖笛",
		"戈尔迪之结",
		"地精爷爷",
		"迷你火箭",

		-- 6
		"烂电线",
		"杯子和球",
		"硬化橡胶塞",
		"不搭的纽扣",
		"二手假牙",

		-- 11
		"机器人玩偶",
		"干瘪的触手",
		"橘子汽水",
		"巫毒人偶",
		"尤克里里",

		-- 16
		"车牌",
		"旧靴子",
		"古代花瓶",
		"脑云丸",
		"六分仪",

		-- 21
		"玩具船",
		"酒瓶蜡烛",
		"损坏的沟通辅助装置",
	},

	DST = {

	}
}

RG_AddLoc(function()
	for k,v in pairs(data)do
		for i,v in ipairs(v) do
			STRINGS.NAMES["RG_TRINKET_"..k.."_"..i] = v
		end
	end
end)

local BUFFS = {}
local DS = "ds"
local DST = "dst"

local function PackValue(value)
	if type(value) == "table" then
		for i = 1, #value do
			value[value[i][2]--[[name]]] = value[i][1] --[[number]]
		end
		return value
	else
		return PackValue({{value, "value"}})
	end
end

--- buff class
local BaseBuff = Class(function(self, data)
	self.field = assert(data[1], "field not defined.")
	self.index = assert(data[2], "index not defined.")

	self.value 	  = PackValue(data.value)
	self.id 	  = data.id
	if data.isshadow == true then
		self.isshadow = true
		self.id = self.id .. "-S"
	end

	self.rarity   = self:ConvertRarity(data.rarity)
	self.onhold   = data.onhold
	self.onpickup = data.onpickup


	BUFFS[self.id] = self
end)

function BUFFS:GetById(id)
	return BUFFS[id]
end

--- buffs
local B = BaseBuff

B{
	DS,1, -- 熔化的弹珠
	id = "ranged_damage",
	desc = "远程武器的基础攻击力增加{}",
	value = 5,
}

B{
	DS,1, isshadow = true,
	id = "ranged_damage",
	desc = "远程武器的基础攻击力增加{}，近战武器的基础攻击力减少{}",
	value = {{10, "up"}, {10, "down"}},
}

B{ 
	DS,2, -- 假卡祖笛
}

B{
	DS,3,
}

B{
	DS,4,
}

B{
	DS,5,
	id = "dart_explosive",
	desc = "吹箭类武器命中目标时，额外造成{%}基础攻击力的小范围爆炸伤害（可触发武器特性）",
	value = {{20/100, "percent"}, {2, "radius"}},
}

B{
	DS,5, isshadow = true,
	id = "dart_explosive",
	desc = "吹箭类武器命中目标时，只造成{%}基础攻击力的大范围爆炸伤害（可触发武器特性）",
	value = {{50/100, "percent"}, {3.5, "radius"}},
}

------------ 6 -> 10 --------------
B{
	DS,6, 
	id = "electric_interval",
	desc = "敌人在触电状态下的电击间隔缩短",
	value = 0.8, -- x@time
	def_extend = {"electric"},
}
B{
	DS,6, isshadow = true,
	id = "electric_interval",
	desc = "触电状态下的电击间隔大幅缩短",
	value = 0.5, 
	def_extend = {"electric"},
}

------------ 11 -> 15 --------------
B{
	DS,12,
	id = "no_ice",
	desc = "敌人的寒冷层数叠满后不会触发冰冻",
	def_extend = {"ice"}

}

B{
	DS,12, isshadow = true,
	desc = "移除冰冻，寒冷最大层数+1。",
	value = true,
	def_extend = {"ice"},
}

B{
	DS,14, 
	desc = "当敌人同时陷入2种异常状态时，你的攻击附带{%}的几率施加诅咒",
	value = 0.05,
	def_extend = {"cursed"},
}

B{
	DS,14, isshadow = true,
	desc = "当敌人同时陷入4种异常状态时，你的每次攻击都会施加诅咒",
	def_extend = {"cursed"},
}


return BUFFS

